"use strict";
//泛型可以传入多个<T,U>；返回可以 T|U 代表或的关系
function hello(data, data2) {
    console.log(data, data2);
    return Date.now() % 2 ? data : data2;
}
hello("abc", 1);
hello(123, true);
let pt = {
    name: "张三",
    age: 18,
    sex: "男",
    extraInfo: {
        title: "前端",
        company: "百度",
    },
};
//泛型类
class Personkk {
    constructor(name, age, extraInfo) {
        this.name = name;
        this.age = age;
        this.extraInfo = extraInfo;
    }
    speak() {
        console.log(`我是学生，我的名字${this.name},今年${this.age}`);
        console.log(this.extraInfo);
    }
}
const pk = new Personkk("tom", 12, {
    title: "前端",
    company: "百度",
});
